package com.jt.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@Accessors(chain = true)
public class JsonResult {

    private Object data;//封装数据的对象
    private Integer status=200;//定义状态码，200为正常，默认为200
    private String msg="ok";//封装返回信息

    public JsonResult(Object data){
        this.data=data;
    }

    public JsonResult(Exception e){//封装异常信息
        this.msg=e.getMessage();
        this.status=0;
    }

    public JsonResult(Object data,String msg){
        this.data=data;
        this.msg=msg;
    }

}
